from django.http import JsonResponse
def login_required(fn):
    def inner(request):
        if request.user.is_authenticated:
            return fn(request)
        else:
            return JsonResponse({'errno':'4101','errmsg':'用户未登录'})
    return inner